package com.music.service.impl;

import com.music.common.BaseResult;
import com.music.dao.CmMyHomePageMusicMapper;
import com.music.entity.CmMusic;
import com.music.service.CmMyHomePageMusicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author Tong
 * @Date 2020/12/17 11:41
 */
@Service
public class CmMyHomePageMusicServiceImpl implements CmMyHomePageMusicService {
    @Autowired
    CmMyHomePageMusicMapper cmMyHomePageMusicMapper;

    @Override
    public BaseResult CmMyHomePageMusicfind() {

        BaseResult baseResult = new BaseResult();
        List<CmMusic> cmMusics = cmMyHomePageMusicMapper.CmMyHomePageMusicfind();
        if(cmMusics!=null){
            baseResult.setData(cmMusics);
            baseResult.setCode(200);
            baseResult.setMessage("查询成功");
            return baseResult;
        }
        baseResult.setCode(201);
        baseResult.setMessage("查询失败");
        return baseResult;
    }
}
